-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: contract addresses #348
Conversation
Warning Rate limit exceeded@fadeev has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 45 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughWalkthroughThe changes introduce two new JSON files, Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #348 +/- ##
=======================================
Coverage 97.37% 97.37%
=======================================
Files 7 7
Lines 305 305
Branches 98 98
=======================================
Hits 297 297
Misses 8 8 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- v2/data/addresses.mainnet.json (1 hunks)
- v2/data/addresses.testnet.json (1 hunks)
- v2/data/readme.md (1 hunks)
Files skipped from review due to trivial changes (1)
- v2/data/readme.md
Additional comments not posted (4)
v2/data/addresses.mainnet.json (3)
1-381
: The file structure and data format look good!The JSON array of objects follows a consistent structure, with each object representing a blockchain address and its associated metadata. The data format appears to be well-defined and adheres to the expected schema.
4-4
: Verify the consistency ofcategory
values.The
category
property seems to have a limited set of allowed values. Ensure that allcategory
values are valid and consistent throughout the array.Also applies to: 11-11, 18-18, 25-25, 32-32, 39-39, 46-46, 53-53, 60-60, 67-67, 74-74, 81-81, 88-88, 95-95, 102-102, 109-109, 116-116, 123-123, 130-130, 137-137, 144-144, 151-151, 158-158, 165-165, 172-172, 179-179, 186-186, 193-193, 200-200, 207-207, 220-220, 233-233, 246-246, 259-259, 272-272, 285-285, 298-298, 311-311, 324-324, 337-337, 349-349, 362-362, 376-376
Verification successful
Category values are consistent.
The
category
values inv2/data/addresses.mainnet.json
are consistent with the expected values "messaging" and "omnichain" as mentioned in the review comment. No discrepancies were found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of `category` values. # Test: Extract unique `category` values. # Expect: Only valid categories like "messaging", "omnichain", etc. jq -r '.[].category' v2/data/addresses.mainnet.json | sort | uniqLength of output: 87
7-7
: Verify the consistency oftype
values.Similar to the
category
property, thetype
property appears to have a predefined set of allowed values. Validate that alltype
values are consistent and match the expected set of values.Also applies to: 14-14, 21-21, 28-28, 35-35, 42-42, 49-49, 56-56, 63-63, 70-70, 77-77, 84-84, 91-91, 98-98, 105-105, 112-112, 119-119, 126-126, 133-133, 140-140, 147-147, 154-154, 161-161, 168-168, 175-175, 182-182, 189-189, 196-196, 203-203, 211-211, 224-224, 237-237, 250-250, 263-263, 276-276, 289-289, 302-302, 315-315, 328-328, 341-341, 354-354, 367-367, 379-379
v2/data/addresses.testnet.json (1)
1-439
: LGTM!The
addresses.testnet.json
file looks good overall:
- The JSON structure is valid and consistent.
- The data format and properties used for each address object seem appropriate and well-organized.
- Categorizing the addresses by
category
andtype
provides a clear way to identify their functionality.- Including the
chain_id
andchain_name
properties helps specify the blockchain network for each address.- The additional properties like
asset
,coin_type
,decimals
,description
,foreign_chain_id
, andsymbol
give useful context about associated assets where applicable.I didn't find any glaring issues or inconsistencies with the data. Nice work on putting together this comprehensive list of addresses!
@@ -0,0 +1,381 @@ | |||
[ | |||
{ | |||
"address": "0x000007Cf399229b2f5A4D043F20E90C9C98B7C6a", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Duplicate address
values found in addresses.mainnet.json
.
The following address
values are duplicated in the JSON file, which may affect data integrity:
0x70e967acFcC17c3941E87562161406d41676FD83
0x7828F92E7d79E141189f24C98aceF71Bc07bad3f
0xaeB6dDB7708467814D557e340283248be8E43124
0xaf28a257D292e7f0E531073f70a175b57E0261a8
Please review and ensure each address
is unique.
Analysis chain
Verify the uniqueness of address
values.
To ensure data integrity, it's important to confirm that each address
value is unique across all objects in the array.
Also applies to: 10-10, 17-17, 24-24, 31-31, 38-38, 45-45, 52-52, 59-59, 66-66, 73-73, 80-80, 87-87, 94-94, 101-101, 108-108, 115-115, 122-122, 129-129, 136-136, 143-143, 150-150, 157-157, 164-164, 171-171, 178-178, 185-185, 192-192, 199-199, 206-206, 219-219, 232-232, 245-245, 258-258, 271-271, 284-284, 297-297, 310-310, 323-323, 336-336, 348-348, 361-361, 375-375
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the uniqueness of `address` values.
# Test: Extract `address` values and check for duplicates.
# Expect: No output, indicating no duplicates found.
jq -r '.[].address' v2/data/addresses.mainnet.json | sort | uniq -d
Length of output: 241
Tip
Codebase Verification
Inconsistent Address Formats Detected
The address formats for the specified chain_name
values are inconsistent with the expected standards. Ethereum-based chains ("eth_mainnet", "bsc_mainnet", "polygon_mainnet", "zeta_mainnet") have addresses starting with "bc1q", which is incorrect. Similarly, "btc_mainnet" has addresses starting with "0x", which is also incorrect. Please review and correct these address formats.
- Ethereum-based chains should have addresses starting with "0x".
- Bitcoin-based chains should have addresses starting with "bc1q".
Analysis chain
Verify the consistency of address
formats for each chain_name
.
Each chain_name
likely has its own expected format for address
values. It's crucial to validate that the address
values adhere to the correct format based on the associated chain_name
.
Also applies to: 10-10, 17-17, 24-24, 31-31, 38-38, 45-45, 52-52, 59-59, 66-66, 73-73, 80-80, 87-87, 94-94, 101-101, 108-108, 115-115, 122-122, 129-129, 136-136, 143-143, 150-150, 157-157, 164-164, 171-171, 178-178, 185-185, 192-192, 199-199, 206-206, 219-219, 232-232, 245-245, 258-258, 271-271, 284-284, 297-297, 310-310, 323-323, 336-336, 348-348, 361-361, 375-375
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the consistency of `address` formats for each `chain_name`.
# Test: Check if `address` values start with "0x" for `chain_name` "eth_mainnet".
# Expect: All `address` values should start with "0x".
jq -r 'select(.[].chain_name == "eth_mainnet") | .[].address' v2/data/addresses.mainnet.json | grep -v '^0x'
# Test: Check if `address` values start with "0x" for `chain_name` "bsc_mainnet".
# Expect: All `address` values should start with "0x".
jq -r 'select(.[].chain_name == "bsc_mainnet") | .[].address' v2/data/addresses.mainnet.json | grep -v '^0x'
# Test: Check if `address` values start with "0x" for `chain_name` "polygon_mainnet".
# Expect: All `address` values should start with "0x".
jq -r 'select(.[].chain_name == "polygon_mainnet") | .[].address' v2/data/addresses.mainnet.json | grep -v '^0x'
# Test: Check if `address` values start with "0x" for `chain_name` "zeta_mainnet".
# Expect: All `address` values should start with "0x".
jq -r 'select(.[].chain_name == "zeta_mainnet") | .[].address' v2/data/addresses.mainnet.json | grep -v '^0x'
# Test: Check if `address` values start with "bc1q" for `chain_name` "btc_mainnet".
# Expect: All `address` values should start with "bc1q".
jq -r 'select(.[].chain_name == "btc_mainnet") | .[].address' v2/data/addresses.mainnet.json | grep -v '^bc1q'
Length of output: 4173
"address": "0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0", | ||
"asset": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", | ||
"category": "omnichain", | ||
"chain_id": 7000, | ||
"chain_name": "zeta_mainnet", | ||
"coin_type": "erc20", | ||
"decimals": 18, | ||
"description": "ZetaChain ZRC20 USDC on BSC", | ||
"foreign_chain_id": "56", | ||
"symbol": "USDC.BSC", | ||
"type": "zrc20" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Incomplete Metadata for "zrc20" Objects
The verification process found that several "zrc20" objects have incomplete metadata due to empty "asset" fields. Please ensure that all required properties have valid values.
- Objects with empty "asset" fields:
- Address:
0x13A0c5930C028511Dc02665E7285134B6d11A5f4
- Address:
0x48f80608B672DC30DC7e3dbBd0343c5F02C738Eb
- Address:
0xADF73ebA3Ebaa7254E859549A44c74eF7cff7501
- Address:
0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891
- Address:
Analysis chain
Verify the completeness of metadata for "zrc20" objects.
Objects with type
"zrc20" contain additional metadata properties. Ensure that all required metadata properties are present and have valid values for each "zrc20" object.
Also applies to: 218-230, 231-243, 245-256, 257-269, 270-282, 283-295, 296-308, 309-321, 322-334, 335-347, 348-360, 361-373
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the completeness of metadata for "zrc20" objects.
# Test: Check if all "zrc20" objects have the required metadata properties.
# Expect: All objects should have "address", "asset", "category", "chain_id", "chain_name",
# "coin_type", "decimals", "description", "foreign_chain_id", "symbol", and "type".
jq -r 'select(.[].type == "zrc20") | select(has("address") and has("asset") and has("category") and has("chain_id") and has("chain_name") and has("coin_type") and has("decimals") and has("description") and has("foreign_chain_id") and has("symbol") and has("type") | not)' v2/data/addresses.mainnet.json
# Test: Check if all "zrc20" objects have non-empty values for the required metadata properties.
# Expect: All required properties should have non-empty values.
jq -r 'select(.[].type == "zrc20") | select((.address == "") or (.asset == "") or (.category == "") or (.chain_id == "") or (.chain_name == "") or (.coin_type == "") or (.decimals == "") or (.description == "") or (.foreign_chain_id == "") or (.symbol == "") or (.type == ""))' v2/data/addresses.mainnet.json
Length of output: 802
Script:
#!/bin/bash
# Description: Verify the completeness of metadata for "zrc20" objects.
# Test: Check if all "zrc20" objects have the required metadata properties.
# Expect: All objects should have "address", "asset", "category", "chain_id", "chain_name",
# "coin_type", "decimals", "description", "foreign_chain_id", "symbol", and "type".
jq -r '.[] | select(.type == "zrc20") | select(has("address") and has("asset") and has("category") and has("chain_id") and has("chain_name") and has("coin_type") and has("decimals") and has("description") and has("foreign_chain_id") and has("symbol") and has("type") | not)' v2/data/addresses.mainnet.json
# Test: Check if all "zrc20" objects have non-empty values for the required metadata properties.
# Expect: All required properties should have non-empty values.
jq -r '.[] | select(.type == "zrc20") | select((.address == "") or (.asset == "") or (.category == "") or (.chain_id == "") or (.chain_name == "") or (.coin_type == "") or (.decimals == "") or (.description == "") or (.foreign_chain_id == "") or (.symbol == "") or (.type == ""))' v2/data/addresses.mainnet.json
Length of output: 1910
"category": "messaging", | ||
"chain_id": 1, | ||
"chain_name": "eth_mainnet", | ||
"type": "connector" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have some contracts here that are not used in v2, like connector etc, which tools depend on having these addresses in v2 folder?
"scripts": { | ||
"lint": "npx eslint . --ignore-pattern coverage/ --ignore-pattern coverage.json --ignore-pattern lib/ --ignore-pattern out --ignore-pattern cache_forge/", | ||
"lint:fix": "npx eslint . --fix --ignore-pattern coverage/ --ignore-pattern coverage.json --ignore-pattern lib/ --ignore-pattern out --ignore-pattern cache_forge/", | ||
"test": "forge clean && forge test -vvv", | ||
"coverage": "forge clean && forge coverage --no-match-coverage \"(script|test)\" --report lcov", | ||
"typechain": "npx typechain --target ethers-v6 \"out/**/!(*.t|test).sol/!(*.abi).json\" --out-dir types", | ||
"generate": "forge clean && forge build && forge fmt && ./scripts/generate_go.sh || true && yarn lint:fix && yarn typechain", | ||
"generate": "forge clean && forge build && forge fmt && ./scripts/generate_go.sh || true && yarn lint:fix && yarn typechain && yarn docs && del-cli dist && tsc || true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you give more details on these changes, why we need dist folder, is it the output of typescript if needed i would move it to separate npm script and call that script here
Summary by CodeRabbit
New Features
Documentation